<?
if(!ANTIHACK) die("ANTIHACK...");
include_once(INCLUDES."buildlink.php");
include_once(INCLUDES."paging.php");
$table="gallery_album";

$where="";
$total=0;$start=0;$limit=10;
$listpage= paging($table,$where,$_GET,$total,$start,$limit,5);
//lay danh sach bai post
$q=query("select * from $table order by sort asc limit $start,$limit");
while($r=fetch($q))
{
	$r["time"]= date("H:i m/m/Y",$r["time"]);
	$r["link"]=buildlink("hinhanh",$r);
	$q1=query("select * from gallery_item where parent=$r[id] limit 1");
	$r1=fetch($q1);
	$r["thumb"]=$r1["content"];
	$data[]=$r;
}

$smarty->assign("listpage",$listpage);
$smarty->assign("curpage",$_GET["page"]);
$smarty->assign("data",$data);
$smarty->display("hinh-anh.htm");
?>